package javase1.day11.demo07;

import java.util.ArrayList;
import java.util.List;

public class DemoInterface {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();//多态写法，左父右子

        List<String > result=addNames(list);
        for (int i = 0; i < result.size(); i++) {
            System.out.println(result.get(i));
        }
    }
    public static List<String> addNames(List<String> list){
        list.add("亚瑟");
        list.add("梦奇");
        list.add("兰陵王");
        list.add("猪八戒");
        return list;
    }
}
